<?php
/**
 * Created by PhpStorm.
 * Author: Shadow
 * Date: 2021/12/20
 * Time: 4:03 下午
 * description: api.php
 */

use think\facade\Route;


# 首页 allowCrossDomain() 解决跨域
Route::get('/',"index/index")->allowCrossDomain();

# 登录相关
Route::get('/logins','login/login');

Route::get('/logout','login/logout');
Route::post('/doLogin','login/doLogin');
Route::any('/register','login/register');
Route::post('/sendCode','login/sendCode');
# qq登录回调地址
Route::get('login','login/qqcallback');


# 分类相关

Route::get('cateList','category/list');

# 商品相关
Route::get('list','goods/list');
Route::get('detail/:id','goods/detail');

# 购物车相关
Route::get('cart','cart/cart');
Route::post('addCart','cart/addCart');
Route::post('changeNumber','cart/changeNumber');
Route::post('changeSelected','cart/changeSelected');
Route::post('cartDelete','cart/cartDelete');

# 订单相关
Route::get('getOrderInfo','Order/getOrderInfo');
# 创建订单
Route::post('createOrder','Order/createOrder');
# 支付
Route::post('pay','Order/pay');
# 同步通知结果
Route::get('callback','Notify/callback');
# 异步通知结果
Route::post('syncNotify','Notify/syncNotify');

Route::get('alipay','order/alipay');
Route::get('selfSign','order/selfSign');
